home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1989 October
/
1989-10.d64
/
rgb demo
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
106 lines
10 rem copyright 1989 compute! publications inc. - all rights reserved
20 ifok=0thenpoke55,0:poke56,80:clr
30 ifok=3then700
40 ifpeek(52033)=8thenok=1
50 ifok=0thenok=1:load"rgb kit",8,1
60 ifok=1thenok=2:sys52000
70 goto180
80 p=s+int(y/8)*320+int(x/8)*8+(yand7):pokep,peek(p)or2^(7-(xand7)):return
90 ifabs(x2-x1)>abs(y2-y1)then120
100 m=(x2-x1)/(y2-y1):gosub140:sp=(y1>y2or1):x=x1
110 fory=y1toy2stepsp:gosub80:x=x+m:nexty:return
120 m=(y2-y1)/(x2-x1):gosub140:sp=(x1>x2or1):y=y1
130 forx=x1tox2stepsp:gosub80:y=y+m:nextx:return
140 ifnot(((abs(m)<1)and(x1>x2))or((abs(m)>1)and(y1>y2)))thenreturn
150 x=x1:x1=x2:x2=x:y=y1:y1=y2:y2=y:return
160 u=1/((NULL)*rx):r1=ry*.72
170 fort=btoestepu:x=rx*cos(t)+x1:y=r1*sin(t)+y1:gosub80:nextt:return
180 print"[147]"tab(13)"rgb kit demo"
190 print"the caps lock [146] key now toggles between"
200 print"the fast and slow modes. in the fast"
210 print"mode, the composite screen is blanked."
220 print"you must switch your monitor to rgb to"
230 print"see the screen. the commodore[146]+shift[146]"
240 print"key combination is still active in rgb"
250 print"mode."
260 print"switch your monitor to rgb mode and"
270 print"then press space[146] to cycle the character"
280 print"colors. press return[146] to continue":c=1
290 getk$:ifk$<>" "andk$<>chr$(13)then290
300 ifk$=" "thensys52006,c:c=(c+1)and15:goto290
310 print"[147]let's do a speed test. during the test,"
320 print"the screen fills with random characters."
330 print"use the caps lock[146] key to toggle"
340 print"between fast and slow modes. there is"
350 print"a marked difference in speed between"
360 print"the two modes. to exit the test press return[146]."
370 getk$:ifk$=""then370
380 sys52009,5
390 print"[147]":z=1024
400 c=int(rnd(0)*256):pokez,c
410 getk$:ifk$=chr$(13)then440
420 z=z+1:ifz<2024then400
430 goto390
440 sys52009,20
450 print"[147]normally, the rgb screen displays the"
460 print"same thing as the composite screen."
470 print"it can display the contents of memory"
480 print"anywhere in the 64's address space."
490 print"just for fun, let's look at part of the"
500 print"ram used by the basic interpreter."
510 print"press return[146] to continue."
520 getk$:ifk$=""then520
530 sys52012,0:sys52009,5
540 getk$:ifk$<>chr$(13)then540
550 sys52012,1024:sys52009,20
560 print"[147]the 64 has two character sets which can"
570 print"be toggled in and out by pressing the"
580 print"commodore[146]+shift[146] keys. rgb kit also"
590 print"has two character sets. unlike the"
600 print"normal 64 character sets, rgb kit's sets"
610 print"can be changed very easily. this part"
620 print"of the demo loads a new character set"
630 print"which replaces the uppercase/lowercase"
640 print"set in rgb mode. press commodore[146]+shift[146]";
650 print"to toggle between the new set and the"
660 print"standard set. press return[146] to continue."
670 getk$:ifk$=""then670
680 print"[147]loading character set"
690 print"please wait...":ok=3:sys52003:load"chrset",8,1
700 sys52000:sys52015,40960,1:print"[147] character set demo"
710 forz=0to255:poke1104+z,z:next
720 print"the quick brown fox jumped over":print"the lazy dog."
730 getk$:ifk$<>chr$(13)then730
740 sys52003:sys52000
750 print"[147]rgb kit's most spectacular ability is"
760 print"its ability to display hi-res screens."
770 print"a hi-res screen can be taken from any"
780 print"location in the 64's ram, including the"
790 print"ram under the basic rom, kernal rom and"
800 print"i/o space. press space[146] to generate and"
810 print"display a bitmap screen. press return[146]"
820 print"to exit the demo."
830 getk$:ifk$<>" "andk$<>chr$(13)then830
840 ifk$=chr$(13)then990
850 print"[147]please wait...drawing"
860 fori=0to35:reada:poke49152+i,a:nexti:sys49152:s=32768:c=31744
870 x1=150:y1=85:rx=75:ry=rx:b=0:e=2*(NULL):gosub160
880 x1=115:y1=70:rx=15:ry=rx:b=0:e=2*(NULL):gosub160
890 x1=185:y1=70:rx=15:ry=rx:b=0:e=2*(NULL):gosub160
900 x1=150:y1=90:rx=60:ry=50:b=10*(NULL)/180:e=170*(NULL)/180:gosub160
910 x1=150:y1=90:rx=63:ry=30:b=20*(NULL)/180:e=160*(NULL)/180:gosub160
920 x1=75:y1=150:x2=140:y2=162:gosub90:x1=140:y1=162:x2=160:y2=162:gosub90
930 x1=160:y1=162:x2=225:y2=150:gosub90:x1=225:y1=150:x2=225:y2=190:gosub90
940 x1=225:y1=190:x2=160:y2=178:gosub90:x1=160:y1=178:x2=140:y2=178:gosub90
950 x1=140:y1=178:x2=75:y2=190:gosub90:x1=75:y1=190:x2=75:y2=150:gosub90
960 x1=140:y1=162:x2=140:y2=178:gosub90:x1=160:y1=162:x2=160:y2=178:gosub90
970 sys52000:sys52018,s,c
980 getk$:ifk$<>chr$(13)then980
990 sys52000:print"[147]end of demo.":sys52003:end
1000 data 169,0,168,162,32,153
1010 data 0,128,200,208,250,238
1020 data 7,192,202,208,244,169
1030 data 48,160,0,162,4,153
1040 data 0,124,200,208,250,238
1050 data 25,192,202,208,244,96